# -*- coding: utf-8 -*-
"""
Created on Tue Mar  5 15:03:10 2024

whether equilibrium would change that much if pf current has a little change


@author: xiang
"""
import read_gfile
import numpy as np
import free_boundary_equ as FBG

def robust_analysis(gfile_path=0, 
                    gFit={}):
    
    if gfile_path != 0:
        gFit = read_gfile(gfile_path)
    
    
    # change pf current random for 100 times
    I_pfs = gFit.fbg.I_pfs
    for i in range(100):
        
        
        I_pfsc = I_pfs + np.random.rand(10)*(I_pfs/20)
    
        gFit = FBG.free_boundary(I_pfsc)
        
        
    # analysis the difference of all the results
    
    

# test mode 
if __name__ == '__main__':
    
    gfile_path = ''
    robust_analysis(gfile_path)
    